<?php
class Slog_Autoloader
{
	static protected $_instance;
	protected $loaders;
	
	public function __construct()
	{
		$this->loaders = array();
	}
	
	/**
	 * @return	Slog_Autoloader
	 */
	static public function getInstance()
	{
		return self::$_instance ? self::$_instance : (self::$_instance = new self());
	}
	
	public function add(Slog_Autoloader_Item $item)
	{
		$this->loaders[] = $item;
		spl_autoload_register(array(get_class($item), 'load'));
	}
}

/**
 * @return	Slog_Autoloader
 */
function autoloader()
{
	return Slog_Autoloader::getInstance();
}
